﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using hospital_registration_system.BLL;
using hospital_registration_system.Entity;

namespace hospital_registration_system.Utility
{
    /// <summary>
    /// 用户查询预约时段功能
    /// </summary>
    public class UserClinic_Time
    {
        protected static Clinic_TimeService service = new Clinic_TimeService();
        protected static DepartmentsService departmentsService = new DepartmentsService();
        /// <summary>
        /// 用户通过科室id和时段查询可以预约的时段
        /// </summary>
        /// <param name="time">用户选择的时段</param>
        /// <param name="id">科室id</param>
        /// <returns>可预约的时段链表</returns>
        public static List<Clinic_time> findClinic_TimeByDepartmentsIdAndTime(DateTime time,int id)
        {
            return service.findClinic_TimeByDateAndDepartmentsId(time, id);
        }

        /// <summary>
        /// 通过疾病的id查询科室信息
        /// </summary>
        /// <param name="id">疾病的id</param>
        /// <returns>疾病对应的所有科室信息</returns>
        public static List<Departments> findDepartmentsByIllId(int id)
        {
            return departmentsService.findDepartmentByIllnessId(id);
        }
    }
}
